
import java.util.Scanner;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author TQNINH
 */
public class Administrator {
    
    
    public Administrator() {
        
    }
    
    public static void main(String[] args) {
        int nEmployee = 0;
        int choice;
        Scanner input = new Scanner(System.in);
        input.useDelimiter("\n");
        Employee[] emp = new Employee[10];
        for (int i = 0; i < 10; i++) {
            emp[i] = new Employee();
        }
        do {
            System.out.println("  ***   EMPLOYEE MANAGERMENT   ***");
            System.out.println("  1.Add new employee");
            System.out.println("  2.Display all");
            System.out.println("  3.Exit");
            System.out.println("******************************");
            System.out.print("  Enter your choice (1-3): ");
            choice = input.nextInt();
            
            switch (choice) {
                case 1:
                    System.out.print("Enter Emp's name: ");
                    emp[nEmployee].name = input.next();
                    System.out.print("Enter Emp's address: ");
                    emp[nEmployee].address = input.next();
                    emp[nEmployee].standardizeAdd();
                    System.out.print("Enter Emp's phone number: ");
                    emp[nEmployee].phoneNumber = input.next();
                    emp[nEmployee].standardizePhone();
                    nEmployee++;
                    break;
                case 2:
                    System.out.println("*** Employee Detail ***");
                    System.out.format("%1$-20s %2$-20s %3$-15s\n",
                            "Name", "Address", "Phone Number");
                    for (int i = 0; i < nEmployee; i++) {
                        emp[i].display();
                    }
                    break;
            }
        } while (choice != 3);
    }
}
